package com.jianyun.jyzs.presenter;

import com.hannesdorfmann.mosby3.mvp.MvpBasePresenter;
import com.jianyun.jyzs.bean.OaAppBean;
import com.jianyun.jyzs.bean.OaCustomBean;
import com.jianyun.jyzs.bean.TopBrodCastBean;
import com.jianyun.jyzs.model.OaCustomModel;
import com.jianyun.jyzs.model.imdoel.IOaCustomModel;
import com.jianyun.jyzs.view.iview.IOaCustomView;

import java.util.List;

/**
 * Created by yangshijun on 2018/9/4.
 */

public class OaCustomPresenter extends MvpBasePresenter<IOaCustomView> {

    public void getOaCustomIcon(String userId,String enterpriseCode,String appVersion){
        if (!isViewAttached())return;
        getView().showLoading();
        OaCustomModel.getInstance().getOaCustomImg(userId,enterpriseCode,appVersion,new IOaCustomModel.OnOaImgListener() {

            @Override
            public void onSuccess(OaCustomBean oaCustomBean) {
                getView().onSuccess(oaCustomBean);
            }

            @Override
            public void onSuccess2(List<OaAppBean> oaBeanList) {
                getView().onSuccess2(oaBeanList);
            }

            @Override
            public void onFailed() {

            }
        });
    }


    public void getTopCastBean(String Url){
        if (!isViewAttached())return;
        OaCustomModel.getInstance().getTopcaset(Url, new IOaCustomModel.OnGetTopCastListener() {
            @Override
            public void onGetTopImgSuccess(TopBrodCastBean topBrodCastBean) {
                getView().onGetTopCast(topBrodCastBean);
            }

            @Override
            public void onFailed() {

            }
        });
    }
}
